package com.ushio.gougouwangguo.controller;

import com.ushio.commonmodule.pojo.result.Result;
import com.ushio.commonmodule.pojo.user.User;
import com.ushio.commonmodule.pojo.vo.SeasonEventVo;
import com.ushio.commonmodule.pojo.vo.UserSeasonEventVo;
import com.ushio.gougouwangguo.service.ISeasonEventService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 季节特殊事件表 前端控制器
 * </p>
 *
 * @author 张文凯
 * @since 2025-09-23
 */
@RestController
@RequestMapping("/seasonEvent")
@Tag(name = "季节",description = "详细记录保存季节的信息,季节更替,特殊季节,每个季节对事件的影响")
public class SeasonEventController {

    @Autowired
    ISeasonEventService seasonEventService;
    @PostMapping("/initialize")
    public Result<UserSeasonEventVo> initializeSeasonEvent(@RequestBody User user){
        try{

            UserSeasonEventVo seasonEventVoList = seasonEventService.initializeSeasonEvent(user);

            return Result.success(seasonEventVoList);
        }catch (Exception e){

            e.printStackTrace();

            return Result.fail(e.getMessage());

        }
    }

}
